package com.five.wisdomEat.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.wisdomEat.entity.Business;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BusinessMapper extends BaseMapper<Business> {
    //查询商家信息，是否入驻
    @Select("SELECT b.*,s.s_name FROM business b INNER JOIN settled s ON b.settledId = s.id WHERE b_Number = #{bNumber}")
    List<Business> selectBusinessList(String bNumber);

    //查询商家是否能够登录成功
    @Select("SELECT COUNT(*) FROM business WHERE b_Number = #{bNumber} AND password = #{password}")
    Integer businessLogin(Business business);
}
